package com.sky.system;

import java.util.Properties;

/**
 * @author : wushikai
 * <p>
 * date : 2022-05-07
 * system 深入一点的东西
 */
public class SystemDemo {


    /**
     * 这是 system 深入一点的方法
     * */
    private  static void showProperties ( ){
        Properties properties = System.getProperties();

     /*   for (Object o : properties.keySet()) {

            System.out.println(  "INFO  " + o + " : " +   properties.get(o));
        }
*/

        System.out.println("System.getProperty(java.util.logging.SimpleFormatter.format) = " + System.getProperty("java.util.logging.SimpleFormatter.format"));


    }


    public  static void setProperty( ){


        System.setProperty("username" , "admin");
    }


    public  static void getProperty( ){

        String username = System.getProperty("username");
        System.out.println("username ==> " + username);

    }




    /**
     * 本地方法
     *
     * */
    private  static void arrayCp ( ){
        int[] src = {1,22,333,4444,5555,666666,7777777};
        int[] dest = {10,20,30};
        System.arraycopy(src, 2, dest, 0, 2);

        for(int i=0;i<dest.length;i++) {
            System.out.println(dest[i]);
        }

    }


    public static void main(String[] args){


        showProperties();
        arrayCp();
        setProperty();
        getProperty();

    }


}
